package simple17.fruit;

import simple17.visit.Visit;

//香蕉
public class Banana implements Fruit {
    private int price = 120;

//    public int getPrice() {
//        return price;
//    }

    public void setPrice(int price) {
        this.price = price;
    }

    public Banana() {
    }

    public Banana(int price) {
        this.price = price;
    }

    @Override
    public void fruit() {
        System.out.print("香蕉");
    }

    @Override
    public int price() {
        return price;
    }

    @Override
    public int accept(Visit visit) {//指针可以传递真实的类型
        return visit.sell(this);
    }
}
